import { post } from "../utils/axios";
import Taro from '@tarojs/taro'
const App_ID = Taro.getStorageSync('app_id')
const token = Taro.getStorageSync('token')
const Room_Id = Taro.getStorageSync('app_id')
class Pay {
  // 获取用户可用于支付优惠券列表
  async getUsableCoupon(data) {
    const res = await post("/coupon/user.coupon/available_coupon", {
      app_id: App_ID,
      goods_id: data.goods_id,
      money: data.money,
      room_id: Room_Id,
      status: data.status,
      type: 2
    });
    return res;
  }
  // 余额
  async balanceData(data) {
    const res = await post("api/config.Balance_Pay/index", {
      app_id: App_ID,
      token: token
    });
    return res;
  }
}

export default new Pay;
